package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Mobile   string
	Password string
}

func (u *User) GetUserByMobile() error {
	return DB.Where("mobile=?", u.Mobile).Limit(1).Find(&u).Error
}

func (u *User) Register() error {
	return DB.Create(&u).Error
}
